package cn.com.lms.business.cozmgt.persistence.entity;


import com.bnzj.core.persistence.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.*;
import java.util.List;

/**
 * @Author: 16266
 * @DateTime: 2020/3/13 14:39
 * @Description: 目录管理实体
 */
@Entity
@Getter
@Setter
@ToString(callSuper = true)
@Table(name = "bnz_catalog_manage", schema = "bnzj")
@NamedEntityGraph(name = "CatalogManage.Graph", attributeNodes = {@NamedAttributeNode("children")})
public class CatalogManage extends BaseEntity {

    private static final long serialVersionUID = 1218384414401734260L;

    @Schema(description="目录名称")
    private String dirName;

    @Schema(description="目录父Id")
    private Integer parentId;

    @Schema(description="排序")
    private Long sort;

    @OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
    @JoinColumn(name="parentId")
    private List<CatalogManage> children;
}
